package org.linlinjava.litemall.admin.vo.marketing_manage;

import cn.hutool.core.date.DateUtil;
import org.linlinjava.litemall.db.domain.AgedmallDeductionRule;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author wj
 * @date 2021/10/29 14:54
 */
public class DetailRuleBack {

    private Integer id;


    private String name;


    private Integer type;

    private Integer ruleMethod;

    private BigDecimal ruleValue;

    private String startTime;

    private String endTime;

    private Integer state;

    private String onlineTime;

    private Integer goodsType;

    private Integer storeType;

    private List<RuleGoods> goodsList;

    private List<RuleStore> storeList;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getRuleMethod() {
        return ruleMethod;
    }

    public void setRuleMethod(Integer ruleMethod) {
        this.ruleMethod = ruleMethod;
    }

    public BigDecimal getRuleValue() {
        return ruleValue;
    }

    public void setRuleValue(BigDecimal ruleValue) {
        this.ruleValue = ruleValue;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getOnlineTime() {
        return onlineTime;
    }

    public void setOnlineTime(String onlineTime) {
        this.onlineTime = onlineTime;
    }

    public Integer getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(Integer goodsType) {
        this.goodsType = goodsType;
    }

    public Integer getStoreType() {
        return storeType;
    }

    public void setStoreType(Integer storeType) {
        this.storeType = storeType;
    }

    public List<RuleGoods> getGoodsList() {
        return goodsList;
    }

    public void setGoodsList(List<RuleGoods> goodsList) {
        this.goodsList = goodsList;
    }

    public List<RuleStore> getStoreList() {
        return storeList;
    }

    public void setStoreList(List<RuleStore> storeList) {
        this.storeList = storeList;
    }

    public DetailRuleBack(AgedmallDeductionRule agedmallDeductionRule){
        this.id = agedmallDeductionRule.getId().intValue();
        this.name = agedmallDeductionRule.getName();
        this.type = agedmallDeductionRule.getType();
        this.ruleMethod = agedmallDeductionRule.getMoneyType();
        this.ruleValue = agedmallDeductionRule.getMoney();
        this.startTime = DateUtil.format(agedmallDeductionRule.getStartTime(),"yyyy-MM-dd HH:mm:ss");
        this.endTime = DateUtil.format(agedmallDeductionRule.getEndTime(),"yyyy-MM-dd HH:mm:ss");
        this.state = agedmallDeductionRule.getStat();
        this.onlineTime = DateUtil.format(agedmallDeductionRule.getLastOnlineTime(),"yyyy-MM-dd HH:mm:ss");
        this.goodsType = agedmallDeductionRule.getCanCustomGoodsType();
        this.storeType = agedmallDeductionRule.getCanCustomStoreType();
    }

    public DetailRuleBack() {
    }

    public DetailRuleBack(Integer id, String name, Integer type, Integer ruleMethod, BigDecimal ruleValue, String startTime, String endTime, Integer state, String onlineTime, Integer goodsType, Integer storeType, List<RuleGoods> goodsList, List<RuleStore> storeList) {
        this.id = id;
        this.name = name;
        this.type = type;
        this.ruleMethod = ruleMethod;
        this.ruleValue = ruleValue;
        this.startTime = startTime;
        this.endTime = endTime;
        this.state = state;
        this.onlineTime = onlineTime;
        this.goodsType = goodsType;
        this.storeType = storeType;
        this.goodsList = goodsList;
        this.storeList = storeList;
    }
}
